package com.xinruke.hostels.reservation.controller.pms;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.common.vo.query.RowsDataVO;
import com.xinruke.hostels.reservation.interfaces.dto.*;
import com.xinruke.hostels.reservation.interfaces.dto.pms.MeetingInqueryPmsDetailQueryDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.MeetingInqueryPmsDetailResultDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.MeetingInqueryPmsListQueryDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.MeetingInqueryPmsListQueryResultDto;
import com.xinruke.hostels.reservation.service.MeetingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author Chenry
 * @ClassName MeetingRequisitionFormController
 * @date：2019/7/19
 * @version: V1.0.0
 * @description：会议预订管理
 */
@RestController
@RequestMapping("/meeting/requisitionform")
@Api(tags = "pms会议需求单管理")
public class MeetingRequisitionFormController extends BaseController {

    @Resource
    private MeetingService meetingService;

    /**
     * 询价单待审核列表
     *
     * @return
     */
    @PostMapping("/audit/list")
    @ApiOperation("询价单待审核列表")
    public ResultVO<RowsDataVO<MeetingInqueryPmsListQueryResultDto>> list(@Valid @RequestBody MeetingInqueryPmsListQueryDto params) {
        return meetingService.pmsList(params);
    }


    /**
     * 询价单详情
     *
     * @return
     */
    @PostMapping("/detail")
    @ApiOperation("询价单详情")
    public ResultVO<MeetingInqueryPmsDetailResultDto> orderDetail(@Valid @RequestBody MeetingInqueryPmsDetailQueryDto params) {
        return meetingService.pmsDetail(params);
    }

    /**
     * pms后台人员审核询价单
     *
     * @return
     */
    @PostMapping("/audit")
    @ApiOperation("审核询价单")
    public ResultVO audit(@Valid @RequestBody MeetingInqueryAuditQueryDTO params) {
        return meetingService.audit(params);
    }

}
